//AJAX----
function DefaultError() {
	alert("Ajax occus error!Req content:" + this.req.responseText);
}
function ContentLoader(url,onload,onerror)
{
	this.url=url;
	this.req=null;
	this.onload=onload;
	this.onerror=onerror?onerror:DefaultError;
	this.LoadXMLDoc();
}
ContentLoader.prototype.OnReadyState = function() {
	if (this.req.readyState == 4)//process complete!
	{
		var httpStatus = this.req.status;
		if (httpStatus == 200 || httpStatus == 0)//no error
			this.onload();
		else
			this.onerror();
		//this.onload.call(this);
	}
}
ContentLoader.prototype.LoadXMLDoc = function() {
	if (window.ActiveXObject)
		this.req = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		this.req = new XMLHttpRequest();
	if (this.req) {
		try {
			var loader = this;
			this.req.onreadystatechange = function() {
				loader.OnReadyState();
			}
			this.req.open('POST', this.url + "&tmd=" + Math.random(), true);
			this.req.send(null);
		}
		catch (err) {
			this.onerror();
		}
	}
}
